package cn.xiangxu.telecom.cost.service;

import java.io.Serializable;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.xiangxu.telecom.cost.dao.CostDao;
import cn.xiangxu.telecom.cost.entity.CostInfo;
import cn.xiangxu.telecom.login.service.ApplicationException;

@Service("costService")
public class CostServiceImpl implements Serializable, CostService {
	
	@Resource(name="costDao")
	private CostDao cd;
	
	public List<CostInfo> checkNull() {
		List<CostInfo> list = cd.findAllCost();
		if(list.isEmpty()) {
//			没有查询到数据
			throw new ApplicationException("数据库中没有资费数据");
		}
		return list;
	}
	

}
